Representational State Transfer (“REST”) is an architectural style that when applied to a web service can improve the web service's performance Standardized interfaces and protocols are used by clients and servers to exchange representations of resources. A service based on REST is called a RESTful service. REST is not dependent on any protocol, but many RESTful services use hypertext transfer protocol (“HTTP”) as an underlying protocol.
REST has become the default for most Web and mobile applications (“apps”). Indeed, a large portion of modern mobile apps rely on RESTful services in the backend. These mobile applications can be running on mobile devices (e.g., smartphones, tablets, handheld computers, smart watches, personal digital assistants, handheld game consoles, etc.). The importance of REST is likely to continue growing quickly as technology moves towards an API orientation. Every major development language now includes frameworks for building RESTful Web services.
Business logic-related requests from mobile apps are sent to the backend in a manner that all elements needed to serve the request are provided in a single transaction. This so-called ‘stateless’ protocol style makes sure that a backend request-handler (i.e., server) can serve its frontend client without knowing the context (‘state’) within which the client has initiated the request. Every interaction with a resource could be stateless; that is, request messages are self-contained.
The stateless style of RESTful services constrains client-server communication because there is no client context stored on the server between requests. Each request from a client contains all the information necessary to service the request, and the session state is held in the client. The client begins sending requests when it is ready to make the transition to a new state. While one or more requests are outstanding, the client is considered to be in transition. When in transition, the client mobile application can be in a suspended environment (i.e., a non-responsive state pending a reply from the backend server). This non-responsive state can be of indeterminate length due to system latency while waiting on a response to its request from the server. This suspended environment can cause the mobile device to hang-up until the response is received.
The separation of the frontend mobile app from its backend server introduces this potential latency problem. Mobile apps are considered more vulnerable to the problem because of the potential for an unstable data link between the server and the mobile device.